<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>intel-ipsec-mb: intel-ipsec-mb</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">intel-ipsec-mb<span id="projectnumber">&#160;v1.4</span>
   </div>
   <div id="projectbrief">Documentation of the Intel(R) IPSec Multi-Buffer library</div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">intel-ipsec-mb </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md_C_1_2Users_2mdcornu_2dev_2libraries_8performance_8ipsec-mb_2README"></a> <a href="https://scan.coverity.com/projects/intel-ipsec-mb"><img src="https://scan.coverity.com/projects/16449/badge.svg" alt="Coverity Status" style="pointer-events: none;" class="inline"/></a> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_shared_gcc.yml/badge.svg" alt="Linux Build Shared gcc" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_static_gcc.yml/badge.svg" alt="Linux Build Static gcc" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_shared_clang.yml/badge.svg" alt="Linux Build Shared clang" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_static_clang.yml/badge.svg" alt="Linux Build Static clang" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/linux_build_shared_clang_aesni_emu.yml/badge.svg" alt="Linux Build Shared clang AESNI emulation" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/freebsd_build_shared_clang.yml/badge.svg" alt="FreeBSD Build Shared clang" style="pointer-events: none;" class="inline"/> <img src="https://github.com/intel/intel-ipsec-mb/actions/workflows/freebsd_build_shared_gcc.yml/badge.svg" alt="FreeBSD Build Shared gcc" style="pointer-events: none;" class="inline"/></p>
<h1><a class="anchor" id="autotoc_md0"></a>
Intel(R) Multi-Buffer Crypto for IPsec Library</h1>
<p>The library provides software crypto acceleration primarily targeting packet processing applications. It can be used for application such as: IPsec, TLS, Wireless (RAN), Cable or MPEG DRM.</p>
<p>The library is hosted on <a href="https://github.com/intel/intel-ipsec-mb">GitHub</a> and is used as software crypto provider in <a href="https://www.dpdk.org/">DPDK</a>, <a href="https://github.com/intel/QAT_Engine">Intel(R) QAT Engine</a> and <a href="https://fd.io/">FD.io</a>.</p>
<p>Using crypto interfaces from the above frameworks gives freedom to change providers without subsequent application modifications. The library can also be used directly through its native API.</p>
<p>Key differentiating features:</p>
<ul>
<li>operation chaining (encryption and authentication)</li>
<li>advanced cryptographic pipelining<ul>
<li>job manager with scheduling and dispatching functions</li>
<li>API hides underlying implementation details from an application</li>
</ul>
</li>
<li>multi-buffer and function stitching innovations</li>
<li>low level implementations using latest instruction extensions</li>
</ul>
<h2><a class="anchor" id="autotoc_md1"></a>
Contents</h2>
<ol type="1">
<li>Overview</li>
<li>Processor Extensions</li>
<li>Recommendations</li>
<li>Package Content</li>
<li>Documentation</li>
<li>Compilation</li>
<li>Security Considerations &amp; Options for Increased Security</li>
<li>Installation</li>
<li>Backwards compatibility</li>
<li>Disclaimer (ZUC, KASUMI, SNOW3G)</li>
<li>Legal Disclaimer</li>
<li>FIPS Compliance</li>
<li>DLL Injection</li>
</ol>
<h2><a class="anchor" id="autotoc_md2"></a>
1. Overview</h2>
<p>Intel Multi-Buffer Crypto for IPsec Library is highly-optimized software implementations of the core cryptographic processing for IPsec, which provides industry-leading performance on a range of Intel(R) Processors.</p>
<p>For information on how the library works, see the Intel White Paper: "Fast Multi-buffer IPsec Implementations on Intel Architecture Processors". Jim Guilford, Sean Gulley, et. al.</p>
<p>The easiest way to find it is to search the Internet for the title and Intel White Paper.</p>
<p>Table 1. List of supported cipher algorithms and their implementations. </p><div class="fragment"><div class="line">+----------------------------------------------------------------------+</div>
<div class="line">|                |                   Implementation                    |</div>
<div class="line">| Encryption     +-----------------------------------------------------|</div>
<div class="line">|                | x86_64 | SSE    | AVX    | AVX2   | AVX512 | VAES(5)|</div>
<div class="line">|----------------+--------+--------+--------+--------+--------+--------|</div>
<div class="line">| AES128-GCM     | N      | Y  by8 | N      | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| AES192-GCM     | N      | Y  by8 | N      | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| AES256-GCM     | N      | Y  by8 | N      | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| AES128-CCM     | N      | Y  by8 | Y  by8 | N      | N      | Y by16 |</div>
<div class="line">| AES256-CCM     | N      | Y  by8 | Y  by8 | N      | N      | Y by16 |</div>
<div class="line">| AES128-CBC     | N      | Y(1)   | Y(3)   | N      | N      | Y(6)   |</div>
<div class="line">| AES192-CBC     | N      | Y(1)   | Y(3)   | N      | N      | Y(6)   |</div>
<div class="line">| AES256-CBC     | N      | Y(1)   | Y(3)   | N      | N      | Y(6)   |</div>
<div class="line">| AES128-CTR     | N      | Y  by8 | Y  by8 | N      | N      | Y by16 |</div>
<div class="line">| AES192-CTR     | N      | Y  by8 | Y  by8 | N      | N      | Y by16 |</div>
<div class="line">| AES256-CTR     | N      | Y  by8 | Y  by8 | N      | N      | Y by16 |</div>
<div class="line">| AES128-ECB     | N      | Y(1)   | Y  by8 | Y(10)  | N      | Y by16 |</div>
<div class="line">| AES192-ECB     | N      | Y(1)   | Y  by8 | Y(10)  | N      | Y by16 |</div>
<div class="line">| AES256-ECB     | N      | Y(1)   | Y  by8 | Y(10)  | N      | Y by16 |</div>
<div class="line">| NULL           | Y      | N      | N      | N      | N      | N      |</div>
<div class="line">| AES128-DOCSIS  | N      | Y(2)   | Y(4)   | N      | Y(7)   | Y(8)   |</div>
<div class="line">| AES256-DOCSIS  | N      | Y(2)   | Y(4)   | N      | Y(7)   | Y(8)   |</div>
<div class="line">| DES-DOCSIS     | Y      | N      | N      | N      | Y  x16 | N      |</div>
<div class="line">| 3DES           | Y      | N      | N      | N      | Y  x16 | N      |</div>
<div class="line">| DES            | Y      | N      | N      | N      | Y  x16 | N      |</div>
<div class="line">| KASUMI-F8      | Y      | N      | N      | N      | N      | N      |</div>
<div class="line">| ZUC-EEA3       | N      | Y  x4  | Y  x4  | Y  x8  | Y  x16 | Y  x16 |</div>
<div class="line">| ZUC-EEA3-256   | N      | Y  x4  | Y  x4  | Y  x8  | Y  x16 | Y  x16 |</div>
<div class="line">| SNOW3G-UEA2    | N      | Y  x4  | Y      | Y      | Y  x16 | Y  x16 |</div>
<div class="line">| AES128-CBCS(9) | N      | Y(1)   | Y(3)   | N      | N      | Y(6)   |</div>
<div class="line">| Chacha20       | N      | Y      | Y      | Y      | Y      | N      |</div>
<div class="line">| Chacha20 AEAD  | N      | Y      | Y      | Y      | Y      | N      |</div>
<div class="line">| SNOW-V         | N      | Y      | Y      | N      | N      | N      |</div>
<div class="line">| SNOW-V AEAD    | N      | Y      | Y      | N      | N      | N      |</div>
<div class="line">| PON-CRC-BIP    | N      | Y  by8 | Y  by8 | N      | N      | Y      |</div>
<div class="line">+----------------------------------------------------------------------+</div>
</div><!-- fragment --><p> Notes: <br  />
 (1,2) - By default, decryption is by4 and encryption is x4. <br  />
 On CPU's supporting GFNI, decryption is by8 and encryption is x8. <br  />
 (3,4) - decryption is by8 and encryption is x8 <br  />
 (5) - AVX512 plus VAES, VPCLMULQDQ and GFNI extensions <br  />
 (6) - decryption is by16 and encryption is x16 <br  />
 (7) - same as AES128-CBC for AVX, combines cipher and CRC32 <br  />
 (8) - decryption is by16 and encryption is x16 <br  />
 (9) - currently 1:9 crypt:skip pattern supported <br  />
 (10) - by default, decryption and encryption are AVX by8. <br  />
 On CPUs supporting VAES, decryption and encryption are AVX2-VAES by16. <br  />
</p>
<p>Legend: <br  />
 <code>byY</code> - single buffer Y blocks at a time <br  />
 <code>xY</code> - Y buffers at a time</p>
<p>As an example of how to read table 1 and 2, if one uses AVX512 interface to perform AES128-CBC encryption then there is no native AVX512 implementation for this cipher. In such case, the library uses best available implementation which is AVX for AES128-CBC.</p>
<p>Table 2. List of supported integrity algorithms and their implementations. </p><div class="fragment"><div class="line">+-------------------------------------------------------------------------+</div>
<div class="line">|                   |                   Implementation                    |</div>
<div class="line">| Integrity         +-----------------------------------------------------|</div>
<div class="line">|                   | x86_64 | SSE    | AVX    | AVX2   | AVX512 | VAES(3)|</div>
<div class="line">|-------------------+--------+--------+--------+--------+--------+--------|</div>
<div class="line">| AES-XCBC-96       | N      | Y   x4 | Y   x8 | N      | N      | Y x16  |</div>
<div class="line">| HMAC-MD5-96       | Y(1)   | Y x4x2 | Y x4x2 | Y x8x2 | N      | N      |</div>
<div class="line">| HMAC-SHA1-96      | N      | Y(2)x4 | Y   x4 | Y   x8 | Y  x16 | N      |</div>
<div class="line">| HMAC-SHA2-224_112 | N      | Y(2)x4 | Y   x4 | Y   x8 | Y  x16 | N      |</div>
<div class="line">| HMAC-SHA2-256_128 | N      | Y(2)x4 | Y   x4 | Y   x8 | Y  x16 | N      |</div>
<div class="line">| HMAC-SHA2-384_192 | N      | Y   x2 | Y   x2 | Y   x4 | Y   x8 | N      |</div>
<div class="line">| HMAC-SHA2-512_256 | N      | Y   x2 | Y   x2 | Y   x4 | Y   x8 | N      |</div>
<div class="line">| SHA1              | N      | Y(2)x4 | Y   x4 | Y   x8 | Y  x16 | N      |</div>
<div class="line">| SHA2-224          | N      | Y(2)x4 | Y   x4 | Y   x8 | Y  x16 | N      |</div>
<div class="line">| SHA2-256          | N      | Y(2)x4 | Y   x4 | Y   x8 | Y  x16 | N      |</div>
<div class="line">| SHA2-384          | N      | Y   x2 | Y   x2 | Y   x4 | Y   x8 | N      |</div>
<div class="line">| SHA2-512          | N      | Y   x2 | Y   x2 | Y   x4 | Y   x8 | N      |</div>
<div class="line">| AES128-GMAC       | N      | Y  by8 | N      | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| AES192-GMAC       | N      | Y  by8 | N      | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| AES256-GMAC       | N      | Y  by8 | N      | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| NULL              | Y      | N      | N      | N      | N      | N      |</div>
<div class="line">| AES128-CCM        | N      | Y(5)x4 | Y   x8 | N      | N      | Y x16  |</div>
<div class="line">| AES256-CCM        | N      | Y(5)x4 | Y   x8 | N      | N      | Y x16  |</div>
<div class="line">| AES128-CMAC-96    | Y      | Y(5)x4 | Y   x8 | N      | N      | Y x16  |</div>
<div class="line">| AES256-CMAC-96    | Y      | Y(5)x4 | Y   x8 | N      | N      | Y x16  |</div>
<div class="line">| KASUMI-F9         | Y      | N      | N      | N      | N      | N      |</div>
<div class="line">| ZUC-EIA3          | N      | Y  x4  | Y  x4  | Y  x8  | Y  x16 | Y  x16 |</div>
<div class="line">| ZUC-EIA3-256      | N      | Y  x4  | Y  x4  | Y  x8  | Y  x16 | Y  x16 |</div>
<div class="line">| SNOW3G-UIA2(8)    | N      | Y by4  | Y by4  | N      | Y by32 | Y by32 |</div>
<div class="line">| DOCSIS-CRC32(4)   | N      | Y      | Y      | N      | Y      | Y      |</div>
<div class="line">| HEC               | N      | Y      | Y      | N      | N      | N      |</div>
<div class="line">| POLY1305          | Y      | N      | N      | Y(9)   | Y      | Y      |</div>
<div class="line">| POLY1305 AEAD     | Y      | N      | N      | Y(9)   | Y      | Y      |</div>
<div class="line">| SNOW-V AEAD       | N      | Y  by8 | Y  by8 | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| GHASH             | N      | Y  by8 | N      | Y  by8 | Y  by8 | Y by32 |</div>
<div class="line">| CRC(6)            | N      | Y  by8 | Y  by8 | N      | N      | Y by16 |</div>
<div class="line">| PON-CRC-BIP(7)    | N      | Y      | Y      | N      | N      | Y      |</div>
<div class="line">+-------------------------------------------------------------------------+</div>
</div><!-- fragment --><p> Notes: <br  />
 (1) - MD5 over one block implemented in C <br  />
 (2) - Implementation using SHANI extensions is x2 <br  />
 (3) - AVX512 plus VAES, VPCLMULQDQ, GFNI and IFMA extensions <br  />
 (4) - used only with AES256-DOCSIS and AES128-DOCSIS ciphers <br  />
 (5) - x8 on selected CPU's supporting GFNI <br  />
 (6) - Supported CRC types:</p><ul>
<li>CRC32: Ethernet FCS, SCTP, WIMAX OFDMA <br  />
</li>
<li>CRC24: LTE A, LTE B <br  />
</li>
<li>CRC16: X25, FP data <br  />
</li>
<li>CRC11: FP header <br  />
</li>
<li>CRC10: IUUP data <br  />
</li>
<li>CRC8: WIMAX OFDMA HCS <br  />
</li>
<li>CRC7: FP header <br  />
</li>
<li>CRC6: IUUP header <br  />
 (7) - used only with PON-AES128-CTR cipher <br  />
 (8) - x4/x16 for init keystream generation, then by4/by32 <br  />
 (9) - Only if AVX-IFMA instructions are supported</li>
</ul>
<p>Legend: <br  />
 <code>byY</code>- single buffer Y blocks at a time <br  />
 <code>xY</code>- Y buffers at a time <br  />
</p>
<p>Table 3. Encryption and integrity algorithm combinations </p><div class="fragment"><div class="line">+---------------------------------------------------------------------+</div>
<div class="line">| Encryption    | Allowed Integrity Algorithms                        |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| AES128-GCM    | AES128-GMAC                                         |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| AES192-GCM    | AES192-GMAC                                         |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| AES256-GCM    | AES256-GMAC                                         |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| AES128-CCM    | AES128-CCM                                          |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| AES256-CCM    | AES256-CCM                                          |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| AES128-CBC,   | AES-XCBC-96,                                        |</div>
<div class="line">| AES192-CBC,   | HMAC-SHA1-96, HMAC-SHA2-224_112, HMAC-SHA2-256_128, |</div>
<div class="line">| AES256-CBC,   | HMAC-SHA2-384_192, HMAC-SHA2-512_256,               |</div>
<div class="line">| AES128-CTR,   | AES128-CMAC-96,                                     |</div>
<div class="line">| AES192-CTR,   | NULL,                                               |</div>
<div class="line">| AES256-CTR,   | KASUMI-F9,                                          |</div>
<div class="line">| AES128-ECB,   | ZUC-EIA3, ZUC-EIA3-256,                             |</div>
<div class="line">| AES192-ECB,   | SNOW3G-UIA3,                                        |</div>
<div class="line">| AES256-ECB,   | POLY1305,                                           |</div>
<div class="line">| NULL,         | AES128-GMAC, AES192-GMAC, AES256-GMAC, GHASH        |</div>
<div class="line">| AES128-DOCSIS,|                                                     |</div>
<div class="line">| AES256-DOCSIS,|                                                     |</div>
<div class="line">| DES-DOCSIS,   |                                                     |</div>
<div class="line">| 3DES,         |                                                     |</div>
<div class="line">| DES,          |                                                     |</div>
<div class="line">| Chacha20,     |                                                     |</div>
<div class="line">| KASUMI-F8,    |                                                     |</div>
<div class="line">| ZUC-EEA3,     |                                                     |</div>
<div class="line">| ZUC-EEA3-256, |                                                     |</div>
<div class="line">| SNOW3G-UEA3   |                                                     |</div>
<div class="line">| SNOW-V        |                                                     |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| AES128-DOCSIS,| DOCSIS-CRC32                                        |</div>
<div class="line">| AES256-DOCSIS |                                                     |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| PON-AES128-CTR| PON-CRC-BIP                                         |</div>
<div class="line">|---------------+-----------------------------------------------------|</div>
<div class="line">| CHACHA20 AEAD | POLY1305 AEAD                                       |</div>
<div class="line">+---------------+-----------------------------------------------------+</div>
<div class="line">| SNOW-V AEAD   | SNOW-V AEAD (GHASH)                                 |</div>
<div class="line">+---------------+-----------------------------------------------------+</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md3"></a>
2. Processor Extensions</h2>
<p>Table 4. Processor extensions used in the library </p><div class="fragment"><div class="line">+-------------------------------------------------------------------------+</div>
<div class="line">| Algorithm         | Interface | Extensions                              |</div>
<div class="line">|-------------------+-----------+-----------------------------------------|</div>
<div class="line">| HMAC-SHA1-96,     | AVX512    | AVX512F, AVX512BW, AVX512VL             |</div>
<div class="line">| HMAC-SHA2-224_112,|           |                                         |</div>
<div class="line">| HMAC-SHA2-256_128,|           |                                         |</div>
<div class="line">| HMAC-SHA2-384_192,|           |                                         |</div>
<div class="line">| HMAC-SHA2-512_256 |           |                                         |</div>
<div class="line">|-------------------+-----------+-----------------------------------------|</div>
<div class="line">| DES, 3DES,        | AVX512    | AVX512F, AVX512BW                       |</div>
<div class="line">| DOCSIS-DES        |           |                                         |</div>
<div class="line">|-------------------+-----------+-----------------------------------------|</div>
<div class="line">| HMAC-SHA1-96,     | SSE       | SHANI                                   |</div>
<div class="line">| HMAC-SHA2-224_112,|           | - presence is autodetected and library  |</div>
<div class="line">| HMAC-SHA2-256_128,|           |   falls back to SSE implementation      |</div>
<div class="line">| HMAC-SHA2-384_192,|           |   if not present                        |</div>
<div class="line">| HMAC-SHA2-512_256 |           |                                         |</div>
<div class="line">+-------------------+-----------+-----------------------------------------+</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md4"></a>
3. Recommendations</h2>
<p>Legacy or to be avoided algorithms listed in the table below are implemented in the library in order to support legacy applications. Please use corresponding alternative algorithms instead. </p><div class="fragment"><div class="line">+--------------------------------------------------------------+</div>
<div class="line">| # | Algorithm           | Recommendation | Alternative       |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 1 | DES encryption      | Avoid          | AES encryption    |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 2 | 3DES encryption     | Avoid          | AES encryption    |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 3 | HMAC-MD5 integrity  | Legacy         | HMAC-SHA256       |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 4 | AES-ECB encryption  | Avoid          | AES-CBC, AES-CNTR |</div>
<div class="line">|---+---------------------+----------------+-------------------|</div>
<div class="line">| 3 | HMAC-SHA1 integrity | Avoid          | HMAC-SHA256       |</div>
<div class="line">+--------------------------------------------------------------+</div>
</div><!-- fragment --><p> Intel(R) Multi-Buffer Crypto for IPsec Library depends on C library and it is recommended to use its latest version.</p>
<p>Applications using the Intel(R) Multi-Buffer Crypto for IPsec Library rely on Operating System to provide process isolation. As the result, it is recommended to use latest Operating System patches and security updates.</p>
<h2><a class="anchor" id="autotoc_md5"></a>
4. Package Content</h2>
<ul>
<li>test - Library test applications</li>
<li>perf - Library performance application</li>
<li>lib - Library source files</li>
<li>lib/sse - Intel(R) SSE optimized routines</li>
<li>lib/avx - Intel(R) AVX optimized routines</li>
<li>lib/avx2 - Intel(R) AVX2 optimized routines</li>
<li>lib/avx512 - Intel(R) AVX512 optimized routines</li>
<li>lib/no-aesni - Non-AESNI accelerated routines</li>
</ul>
<p><b>Note:</b> <br  />
 There is just one branch used in the project. All development is done on the master branch. <br  />
 Code taken from the tip of the master branch should not be considered fit for production. <br  />
</p>
<p>Refer to the releases tab for stable code versions: <br  />
 <a href="https://github.com/intel/intel-ipsec-mb/releases">https://github.com/intel/intel-ipsec-mb/releases</a></p>
<h2><a class="anchor" id="autotoc_md6"></a>
5. Documentation</h2>
<p>Full documentation can be found at: <a href="https://intel.github.io/intel-ipsec-mb">https://intel.github.io/intel-ipsec-mb</a></p>
<p>To generate documentation locally, run: <br  />
 <code>&gt; make doxy</code></p>
<h2><a class="anchor" id="autotoc_md7"></a>
6. Compilation</h2>
<h3><a class="anchor" id="autotoc_md8"></a>
Linux (64-bit only)</h3>
<p>Required tools: <br  />
</p><ul>
<li>GNU make <br  />
</li>
<li>NASM version 2.14 (or newer) <br  />
</li>
<li>gcc (GCC) 4.8.3 (or newer) <br  />
</li>
</ul>
<p>Shared library: <br  />
 <code>&gt; make</code></p>
<p>Static library: <br  />
 <code>&gt; make SHARED=n</code></p>
<p>Clean the build: <br  />
 <code>&gt; make clean</code> <br  />
 or <br  />
 <code>&gt; make clean SHARED=n</code></p>
<p>Build with debugging information: <br  />
 <code>&gt; make DEBUG=y</code></p>
<p>Build with AESNI emulation support (disabled by default): <br  />
 <code>&gt; make AESNI_EMU=y</code></p>
<p><b>Note:</b> Building with debugging information is not advised for production use.</p>
<p>For more build options and their explanation run: <br  />
 <code>&gt; make help</code></p>
<h3><a class="anchor" id="autotoc_md9"></a>
Windows MSVS (x64 only)</h3>
<p>Required tools: <br  />
</p><ul>
<li>Microsoft (R) Visual Studio 2019: <br  />
<ul>
<li>NMAKE: Microsoft (R) Program Maintenance Utility Version 14.29.30148.0 <br  />
</li>
<li>CL: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30148 for x64 <br  />
</li>
<li>LIB: Microsoft (R) Library Manager Version 14.29.30148.0 <br  />
</li>
<li>LINK: Microsoft (R) Incremental Linker Version 14.29.30148.0 <br  />
</li>
<li>Note: Building on later versions should work but is not verified <br  />
</li>
</ul>
</li>
<li>NASM version 2.14 (or newer) <br  />
</li>
</ul>
<p>Shared library (DLL): <br  />
 <code>&gt; nmake /f win_x64.mak</code></p>
<p>Static library: <br  />
 <code>&gt; nmake /f win_x64.mak SHARED=n</code></p>
<p>Clean the build: <br  />
 <code>&gt; nmake /f win_x64.mak clean</code> <br  />
 or <br  />
 <code>&gt; nmake /f win_x64.mak clean SHARED=n</code></p>
<p>Build without safety features: <br  />
</p><ul>
<li>SAFE_DATA clears sensitive information stored temporarily on stack, registers or internal data structures <br  />
</li>
<li>SAFE_PARAM adds extra checks on input parameters <br  />
</li>
<li>SAFE_LOOKUP uses constant-time lookups (enabled by default) <br  />
</li>
<li>SAFE_OPTIONS additional option to disable all safe options. Enabled by default. <br  />
 Disable to turn off: SAFE_DATA, SAFE_PARAM and SAFE_LOOKUP. <br  />
</li>
</ul>
<p><code>&gt; nmake /f win_x64.mak SAFE_DATA=n SAFE_PARAM=n</code> <code>&gt; nmake /f win_x64.mak SAFE_OPTIONS=n</code></p>
<p>Build with debugging information: <br  />
 <code>&gt; nmake /f win_x64.mak DEBUG=y</code></p>
<p>Build with AESNI emulation support (disabled by default): <br  />
 <code>&gt; nmake /f win_x64.mak AESNI_EMU=y</code></p>
<p><b>Note:</b> Building with debugging information is not advised for production use.</p>
<p>For more build options and their explanation run: <br  />
 <code>&gt; nmake /f win_x64.mak help</code></p>
<h3><a class="anchor" id="autotoc_md10"></a>
Windows Mingw-w64 (64-bit only)</h3>
<p>Required tools: <br  />
</p><ul>
<li>GNU mingw32-make.exe <br  />
</li>
<li>NASM version 2.14 (or newer) <br  />
</li>
<li>gcc (GCC) 10.3.0 (or newer)</li>
</ul>
<p>Shared library: <br  />
 <code>&gt; mingw32-make.exe</code></p>
<p>Static library: <br  />
 <code>&gt; mingw32-make.exe SHARED=n</code></p>
<p>Clean the build: <br  />
 <code>&gt; mingw32-make.exe clean</code> <br  />
 or <br  />
 <code>&gt; mingw32-make.exe clean SHARED=n</code></p>
<p>Build with debugging information: <br  />
 <code>&gt; mingw32-make.exe DEBUG=y</code></p>
<p><b>Note:</b> Building with debugging information is not advised for production use.</p>
<p>For more build options and their explanation run: <br  />
 <code>&gt; mingw32-make.exe help</code></p>
<h3><a class="anchor" id="autotoc_md11"></a>
FreeBSD (64-bit only)</h3>
<p>Required tools: <br  />
</p><ul>
<li>GNU make <br  />
</li>
<li>NASM version 2.14 (or newer) <br  />
</li>
<li>gcc (GCC) 4.8.3 (or newer) / clang 5.0 (or newer) <br  />
</li>
</ul>
<p>Shared library: <br  />
 <code>&gt; gmake</code></p>
<p>Static library: <br  />
 <code>&gt; gmake SHARED=n</code></p>
<p>Clean the build: <br  />
 <code>&gt; gmake clean</code> <br  />
 or <br  />
 <code>&gt; gmake clean SHARED=n</code></p>
<p>Build with debugging information: <br  />
 <code>&gt; gmake DEBUG=y</code></p>
<p><b>Note:</b> Building with debugging information is not advised for production use.</p>
<p>For more build options and their explanation run: <br  />
 <code>&gt; gmake help</code></p>
<h3><a class="anchor" id="autotoc_md12"></a>
Building with CMake (experimental)</h3>
<p>Minimum CMake version: 3.16</p>
<p>Create build directory: </p><div class="fragment"><div class="line">mkdir build</div>
<div class="line">cd build</div>
</div><!-- fragment --><h4><a class="anchor" id="autotoc_md13"></a>
Unix Makefiles (Linux and FreeBSD)</h4>
<p>Shared library (default): </p><div class="fragment"><div class="line">cmake ..</div>
<div class="line">cmake --build . --parallel</div>
</div><!-- fragment --><p>Static library: </p><div class="fragment"><div class="line">cmake -DBUILD_SHARED_LIBS=OFF ..</div>
<div class="line">cmake --build . --parallel</div>
</div><!-- fragment --><p>Debug build: </p><div class="fragment"><div class="line">cmake -DCMAKE_BUILD_TYPE=Debug ..</div>
<div class="line">cmake --build . --parallel</div>
</div><!-- fragment --><p>For more build options and their explanation run: <code>cmake --build . --target print_help</code></p>
<h4><a class="anchor" id="autotoc_md14"></a>
Windows MSVS (x64 only)</h4>
<p>Shared library with debugging information (default for MSVS) </p><div class="fragment"><div class="line">cmake -Ax64 ..</div>
<div class="line">cmake --build .</div>
</div><!-- fragment --><p>Release build: </p><div class="fragment"><div class="line">cmake -Ax64 ..</div>
<div class="line">cmake --build . --config Release</div>
</div><!-- fragment --><p>Static library: </p><div class="fragment"><div class="line">cmake -Ax64 -DBUILD_SHARED_LIBS=OFF ..</div>
<div class="line">cmake --build . --config Release</div>
</div><!-- fragment --><p>For more build options and their explanation run: <code>cmake --build . --target print_help</code></p>
<h4><a class="anchor" id="autotoc_md15"></a>
Ninja (Linux, FreeBSD and Windows):</h4>
<div class="fragment"><div class="line">cmake -G Ninja ..</div>
<div class="line">cmake --build .</div>
</div><!-- fragment --><p>For more build options and their explanation run: </p><div class="fragment"><div class="line">cmake --build . --target print_help</div>
</div><!-- fragment --><p>Library and applications can be found in: </p><div class="fragment"><div class="line">build/lib</div>
<div class="line">build/test</div>
<div class="line">build/perf</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md16"></a>
7. Security Considerations &amp; Options for Increased Security</h2>
<h3><a class="anchor" id="autotoc_md17"></a>
Security Considerations</h3>
<p>The security of a system that uses cryptography depends on the strength of the cryptographic algorithms as well as the strength of the keys. Cryptographic key strength is dependent on several factors, with some of the most important factors including the length of the key, the entropy of the key bits, and maintaining the secrecy of the key.</p>
<p>The selection of an appropriate algorithm and mode of operation critically affects the security of a system. Appropriate selection criteria is beyond the scope of this document and should be determined based upon usage, appropriate standards and consultation with a cryptographic expert. This library includes some algorithms, which are considered cryptographically weak and are included only for legacy and interoperability reasons. See the "Recommendations" section for more details.</p>
<p>Secure creation of key material is not a part of this library. This library assumes that cryptographic keys have been created using approved methods with an appropriate and secure entropy source. Users of this library are referred to NIST SP800-133 Revision 1, Recommendation for Cryptographic Key Generation, found at <a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-133r1.pdf">https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-133r1.pdf</a></p>
<p>Even with the use of strong cryptographic algorithms and robustly generated keys, software implementations of cryptographic algorithms may be attacked at the implementation through cache-timing attacks, buffer-over-reads, and other software vulnerabilities. Counter-measures against these types of attacks are possible but require additional processing cycles. Whether a particular system should provide such counter-measures depends on the threats to that system, and cannot be determined by a general library such as this one. In order to provide the most flexible implementation, this library allows certain counter-measures to be enabled or disabled at compile time. These options are listed below as the "Options for Increased Security" and are enabled through various build flags.</p>
<h3><a class="anchor" id="autotoc_md18"></a>
Options for Increased Security</h3>
<p>There are three build options that are used to increase safety in the code and help protect external functions from incorrect input data. The SAFE_DATA, SAFE_PARAM and SAFE_LOOKUP options are enabled by default. Due to the potential performance impact associated to the extra code, these can be disabled by setting the parameter equal to "n" (e.g. make SAFE_LOOKUP=n).</p>
<p>No specific code has been added, and no specific validation or security tests have been performed to help protect against or check for side-channel attacks.</p>
<h3><a class="anchor" id="autotoc_md19"></a>
SAFE_DATA</h3>
<p>Stack and registers containing sensitive information, such as keys or IVs, are cleared upon completion of a function call.</p>
<h3><a class="anchor" id="autotoc_md20"></a>
SAFE_PARAM</h3>
<p>Input parameters are checked, looking generally for NULL pointers or an incorrect input length.</p>
<h3><a class="anchor" id="autotoc_md21"></a>
SAFE_LOOKUP</h3>
<p>Lookups which depend on sensitive information are implemented with constant time functions.</p>
<p>Algorithms where these constant time functions are used are the following: <br  />
</p><ul>
<li>AESNI emulation <br  />
</li>
<li>DES: SSE, AVX and AVX2 implementations <br  />
</li>
<li>KASUMI: all architectures <br  />
</li>
<li>SNOW3G: all architectures <br  />
</li>
</ul>
<p>If SAFE_LOOKUP is not enabled in the build (e.g. make SAFE_LOOKUP=n) then the algorithms listed above may be susceptible to timing attacks which could expose the cryptographic key.</p>
<h3><a class="anchor" id="autotoc_md22"></a>
SAFE_OPTIONS</h3>
<p>SAFE_OPTIONS is a parameter that can be used to disable/enable all supported safe options (i.e. SAFE_DATA, SAFE_PARAM, SAFE_LOOKUP). It is set to <code>y</code> by default and all safe options are enabled. <code>SAFE_OPTIONS=n</code> disables all safe options.</p>
<h3><a class="anchor" id="autotoc_md23"></a>
Security API</h3>
<p><b>Force clearing/zeroing of memory</b> </p><div class="fragment"><div class="line"><a class="code hl_define" href="intel-ipsec-mb_8h.html#a986643689f56109161597f67eb9d7b40">IMB_DLL_EXPORT</a> <span class="keywordtype">void</span> <a class="code hl_function" href="intel-ipsec-mb_8h.html#aecdd69541b6d2a83d19ca804ef4b78d6">imb_clear_mem</a>(<span class="keywordtype">void</span> *mem, <span class="keyword">const</span> <span class="keywordtype">size_t</span> size);</div>
<div class="ttc" id="aintel-ipsec-mb_8h_html_a986643689f56109161597f67eb9d7b40"><div class="ttname"><a href="intel-ipsec-mb_8h.html#a986643689f56109161597f67eb9d7b40">IMB_DLL_EXPORT</a></div><div class="ttdeci">#define IMB_DLL_EXPORT</div><div class="ttdef"><b>Definition</b> intel-ipsec-mb.h:86</div></div>
<div class="ttc" id="aintel-ipsec-mb_8h_html_aecdd69541b6d2a83d19ca804ef4b78d6"><div class="ttname"><a href="intel-ipsec-mb_8h.html#aecdd69541b6d2a83d19ca804ef4b78d6">imb_clear_mem</a></div><div class="ttdeci">IMB_DLL_EXPORT void imb_clear_mem(void *mem, const size_t size)</div><div class="ttdoc">Force clearing/zeroing of memory.</div></div>
</div><!-- fragment --><p> To assist in clearing sensitive application data such as keys, plaintext etc. the library provides the <code><a class="el" href="intel-ipsec-mb_8h.html#aecdd69541b6d2a83d19ca804ef4b78d6" title="Force clearing/zeroing of memory.">imb_clear_mem()</a></code> API. This API zeros _'size'_ bytes of memory pointed to by _'mem'_ followed by the <em>sfence</em> instruction to ensure memory is cleared before the function returns.</p>
<h3><a class="anchor" id="autotoc_md24"></a>
Galois Counter Mode (GCM) TAG Size</h3>
<p>The library GCM and GMAC implementation provides flexibility as to tag size selection. As explained in <a href="https://csrc.nist.gov/publications/detail/sp/800-38d/final">NIST Special Publication 800-38D</a> section 5.2.1.2 and Appendix C, using tag sizes shorter than 96 bits can be insecure. Please refer to the aforementioned sections to understand the details, trade offs and mitigations of using shorter tag sizes.</p>
<h2><a class="anchor" id="autotoc_md25"></a>
8. Installation</h2>
<h3><a class="anchor" id="autotoc_md26"></a>
Linux (64-bit only)</h3>
<p>First compile the library and then install: <br  />
 <code>&gt; make</code> <br  />
 <code>&gt; sudo make install</code></p>
<p>To uninstall the library run: <br  />
 <code>&gt; sudo make uninstall</code></p>
<p>If you want to change install location then define PREFIX: <br  />
 <code>&gt; sudo make install PREFIX=&lt;path&gt;</code></p>
<p>If there is no need to run ldconfig at install stage please use NOLDCONFIG=y option: <br  />
 <code>&gt; sudo make install NOLDCONFIG=y</code></p>
<p>If library was compiled as an archive (not a default option) then install it using SHARED=n option: <br  />
 <code>&gt; sudo make install SHARED=n</code></p>
<h3><a class="anchor" id="autotoc_md27"></a>
Windows (x64 only)</h3>
<p>First compile the library and then install from a command prompt in administrator mode: <br  />
 <code>&gt; nmake /f win_x64.mak</code> <br  />
 <code>&gt; nmake /f win_x64.mak install</code></p>
<p>To uninstall the library run: <br  />
 <code>&gt; nmake /f win_x64.mak uninstall</code></p>
<p>If you want to change install location then define PREFIX (default C:\Program Files): <br  />
 <code>&gt; nmake /f win_x64.mak install PREFIX=&lt;path&gt;</code></p>
<p>If library was compiled as a static library (not a default option) then install it using SHARED=n option: <br  />
 <code>&gt; nmake /f win_x64.mak install SHARED=n</code></p>
<h3><a class="anchor" id="autotoc_md28"></a>
FreeBSD (64-bit only)</h3>
<p>First compile the library and then install: <br  />
 <code>&gt; gmake</code> <br  />
 <code>&gt; sudo gmake install</code></p>
<p>To uninstall the library run: <br  />
 <code>&gt; sudo gmake uninstall</code></p>
<p>If you want to change install location then define PREFIX: <br  />
 <code>&gt; sudo gmake install PREFIX=&lt;path&gt;</code></p>
<p>If there is no need to run ldconfig at install stage please use NOLDCONFIG=y option: <br  />
 <code>&gt; sudo gmake install NOLDCONFIG=y</code></p>
<p>If library was compiled as an archive (not a default option) then install it using SHARED=n option: <br  />
 <code>&gt; sudo gmake install SHARED=n</code></p>
<h2><a class="anchor" id="autotoc_md29"></a>
Installing with CMake (experimental)</h2>
<h3><a class="anchor" id="autotoc_md30"></a>
Unix (Linux and FreeBSD)</h3>
<p>First compile the library and then install: <br  />
 </p><div class="fragment"><div class="line">cmake --build .</div>
<div class="line">sudo cmake --install .</div>
</div><!-- fragment --><p>To uninstall the library run: <br  />
 <code>sudo cmake --build . --target uninstall</code></p>
<p>If you want to change install location then define PREFIX: <br  />
 <code>sudo cmake --install . --prefix=&lt;path&gt;</code></p>
<h3><a class="anchor" id="autotoc_md31"></a>
Windows (x64 only)</h3>
<p>First compile the library and then install from a command prompt in administrator mode: <br  />
 </p><div class="fragment"><div class="line">cmake --build . --config Release</div>
<div class="line">cmake --install . --config Release</div>
</div><!-- fragment --><p>To uninstall the library run: <br  />
 <code>cmake --build . --target uninstall</code></p>
<p>If you want to change install location then define PREFIX (default C:\Program Files): <br  />
 <code>cmake --install . --config Release --prefix=&lt;path&gt;</code></p>
<h2><a class="anchor" id="autotoc_md32"></a>
9. Backwards compatibility</h2>
<p>In version 1.4, backward compile time symbol compatibility with library version 0.53 has been removed.</p>
<p>Applications are encouraged to use new symbol names introduced in version 0.54.</p>
<p>If required, compatibility symbol mapping can be implemented in the application. See compatibility symbol mapping in v1.3 header file: <a href="https://github.com/intel/intel-ipsec-mb/blob/v1.3/lib/intel-ipsec-mb.h#L246">https://github.com/intel/intel-ipsec-mb/blob/v1.3/lib/intel-ipsec-mb.h#L246</a></p>
<h2><a class="anchor" id="autotoc_md33"></a>
10. Disclaimer (ZUC, KASUMI, SNOW3G)</h2>
<p>Please note that cryptographic material, such as ciphering algorithms, may be subject to national regulations. What is more, use of some algorithms in real networks and production equipment can be subject to agreement or licensing by the GSMA and/or the ETSI.</p>
<p>For more details please see: <br  />
</p><ul>
<li>GSMA <a href="https://www.gsma.com/security/security-algorithms/">https://www.gsma.com/security/security-algorithms/</a> <br  />
</li>
<li>ETSI <a href="https://www.etsi.org/security-algorithms-and-codes/cellular-algorithm-licences">https://www.etsi.org/security-algorithms-and-codes/cellular-algorithm-licences</a></li>
</ul>
<h2><a class="anchor" id="autotoc_md34"></a>
11. Legal Disclaimer</h2>
<p>THIS SOFTWARE IS PROVIDED BY INTEL"AS IS". NO LICENSE, EXPRESS OR <br  />
 IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS <br  />
 ARE GRANTED THROUGH USE. EXCEPT AS PROVIDED IN INTEL'S TERMS AND <br  />
 CONDITIONS OF SALE, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL <br  />
 DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR <br  />
 USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO <br  />
 FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT <br  />
 OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. <br  />
</p>
<h2><a class="anchor" id="autotoc_md35"></a>
12. FIPS Compliance</h2>
<p>The library does not fulfill technical requirements to achieve Cryptographic Module (CMVP) certification as a standalone component. It is fit for Cryptographic Algorithm validation and certification (CAVP) and it can be part of CMVP as one of the components.</p>
<h3><a class="anchor" id="autotoc_md36"></a>
CAVP</h3>
<p>ACVP test application located in <code>test</code> directory is to support CAVP process. It implements validation of the following algorithms: <br  />
</p><ul>
<li>AES-GCM <br  />
</li>
<li>AES-GMAC <br  />
</li>
<li>AES-CCM <br  />
</li>
<li>AES-CBC <br  />
</li>
<li>AES-CTR <br  />
</li>
<li>AES-CMAC <br  />
</li>
<li>SHA1 (SHA-1) <br  />
</li>
<li>SHA224 (SHA2-224) <br  />
</li>
<li>SHA256 (SHA2-256) <br  />
</li>
<li>SHA384 (SHA2-384) <br  />
</li>
<li>SHA512 (SHA2-512) <br  />
</li>
<li>HMAC-SHA1 (HMAC-SHA-1) <br  />
</li>
<li>HMAC-SHA224 (HMAC-SHA2-224) <br  />
</li>
<li>HMAC-SHA256 (HMAC-SHA2-256) <br  />
</li>
<li>HMAC-SHA384 (HMAC-SHA2-384) <br  />
</li>
<li>HMAC-SHA512 (HMAC-SHA2-512) <br  />
</li>
</ul>
<h3><a class="anchor" id="autotoc_md37"></a>
CAVP Algorithm Parameters</h3>
<p><b>Note:</b> all sizes in bits </p><div class="fragment"><div class="line">+--------------------------------------------------------------------------------------------+</div>
<div class="line">| Algorithm           | Standard  | Parameters                                               |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-GCM             | SP800-38D | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|                     |           | ivLen: [min = 8, max = 1024, increment 8]                |</div>
<div class="line">|                     |           | tagLen: 32, 64, 96, 104, 112, 120, 128                   |</div>
<div class="line">|                     |           | payloadLen: [min = 0, max = 65536, increment = 8]        |</div>
<div class="line">|                     |           | aadLen: [min = 0, max = 65536, increment = 8]            |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CBC             | SP800-38A | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CTR             | SP800-38A | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|                     |           | payloadLen: [min = 8, max = 128, increment = 8]          |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-ECB             | SP800-38A | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| TDES-EDE-CBC        | SP800-38A | Key size: 192                                            |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA1 (SHA-1)        | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA224 (SHA2-224)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA256 (SHA2-256)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA384 (SHA2-384)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| SHA512 (SHA2-512)   | FIPS180-4 | messageLength: [min = 0, max = 65528, increment = 8]     |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CCM             | SP800-38C | Key size: 128, 256                                       |</div>
<div class="line">|                     |           | Direction: encrypt and decrypt                           |</div>
<div class="line">|                     |           | ivLen: [min = 56, max = 104, increment 8]                |</div>
<div class="line">|                     |           | tagLen: 32, 48, 64, 80, 96, 112, 128                     |</div>
<div class="line">|                     |           | payloadLen: [min = 0, max = 256, increment = 8]          |</div>
<div class="line">|                     |           | aadLen: [min = 0, max = 368, increment = 8]              |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-GMAC            | SP800-38B | Key size: 128, 192, 256                                  |</div>
<div class="line">|                     |           | ivLen: [min = 8, max = 1024, increment 8]                |</div>
<div class="line">|                     |           | tagLen: 32, 64, 96, 104, 112, 120, 128                   |</div>
<div class="line">|                     |           | aadLen: [min = 0, max = 65536, increment = 8]            |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| AES-CMAC            | SP800-38B | Key size: 128, 256                                       |</div>
<div class="line">|                     |           | msgLen: [min = 8, max = 65528, increment 8]              |</div>
<div class="line">|                     |           | macLen: [min = 8, max = 128, increment = 8]              |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA1           | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA-1)        |           | macLen: [min = 32, max = 160, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA224         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-224)     |           | macLen: [min = 32, max = 224, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA256         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-256)     |           | macLen: [min = 32, max = 256, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA384         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-384)     |           | macLen: [min = 32, max = 384, increment = 8]             |</div>
<div class="line">|---------------------+-----------+----------------------------------------------------------|</div>
<div class="line">| HMAC-SHA512         | FIPS198-1 | keyLen: [min = 8, max = 524288, increment = 8]           |</div>
<div class="line">| (HMAC-SHA2-512)     |           | macLen: [min = 32, max = 512, increment = 8]             |</div>
<div class="line">+--------------------------------------------------------------------------------------------+</div>
</div><!-- fragment --> <h3><a class="anchor" id="autotoc_md38"></a>
Self-Test</h3>
<p>In order to support CMVP, the library implements Self-Test functionality that is available with all compilation options. The test is always performed as part of library initialization (power-up). There is no conditional self-test functionality as none of such conditions occur (i.e. pair-wise consistency test, software/firmware load test, manual key entry test, continuous random number generator test, and bypass test). The self-test consists of Cryptographic algorithm test (known answer test) on following algorithms: <br  />
</p><ul>
<li>AES-GCM <br  />
</li>
<li>AES-GMAC <br  />
</li>
<li>AES-CCM <br  />
</li>
<li>AES-CBC <br  />
</li>
<li>AES-CTR <br  />
</li>
<li>AES-ECB <br  />
</li>
<li>TDES-EDE-CBC <br  />
</li>
<li>AES-CMAC <br  />
</li>
<li>SHA1 <br  />
</li>
<li>SHA224 <br  />
</li>
<li>SHA256 <br  />
</li>
<li>SHA384 <br  />
</li>
<li>SHA512 <br  />
</li>
<li>HMAC-SHA1 <br  />
</li>
<li>HMAC-SHA224 <br  />
</li>
<li>HMAC-SHA256 <br  />
</li>
<li>HMAC-SHA384 <br  />
</li>
<li>HMAC-SHA512 <br  />
</li>
</ul>
<p>Example detection of library self-test completion &amp; error in the application: </p><div class="fragment"><div class="line">IMB_ARCH arch;</div>
<div class="line">IMB_MGR *p_mgr = alloc_mb_mgr(0);</div>
<div class="line"> </div>
<div class="line">init_mb_mgr_auto(p_mgr, &amp;arch); /* or init_mb_mgr_sse/avx/avx2/avx512 */</div>
<div class="line"> </div>
<div class="line">/*</div>
<div class="line"> * check for self-test presence and successful</div>
<div class="line"> * - requires library version v1.3 or newer</div>
<div class="line"> */</div>
<div class="line">if (p_mgr-&gt;features &amp; IMB_FEATURE_SELF_TEST) {</div>
<div class="line">        /* self-test feature present */</div>
<div class="line">        if (p_mgr-&gt;features &amp; IMB_FEATURE_SELF_TEST_PASS) {</div>
<div class="line">                printf(&quot;SELF-TEST: PASS\n&quot;);</div>
<div class="line">        } else {</div>
<div class="line">                printf(&quot;SELF-TEST: FAIL\n&quot;);</div>
<div class="line">        }</div>
<div class="line">} else {</div>
<div class="line">        printf(&quot;SELF-TEST: N/A (requires library &gt;= v1.3)\n&quot;);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line">/* check for initialization self-test error */</div>
<div class="line">if (imb_get_errno(p_mgr) == IMB_ERR_SELFTEST) {</div>
<div class="line">        /* self-test error */</div>
<div class="line">        exit(EXIT_FAILURE);</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md39"></a>
13.DLL Injection Attack</h2>
<h3><a class="anchor" id="autotoc_md40"></a>
Problem</h3>
<p>The Windows OS has an insecure predefined search order and set of defaults when trying to locate a resource. If the resource location is not specified by the software, an attacker need only place a malicious version in one of the locations Windows will search, and it will be loaded instead. Although this weakness can occur with any resource, it is especially common with DLL files.</p>
<h3><a class="anchor" id="autotoc_md41"></a>
Solutions</h3>
<p>Applications using intel-ipsec-mb DLL library may need to apply one of the solutions to prevent from DLL injection attack.</p>
<p>Two solutions are available:</p><ul>
<li>Using a Fully Qualified Path is the most secure way to load a DLL <br  />
</li>
<li>Signature verification of the DLL <br  />
</li>
</ul>
<h3><a class="anchor" id="autotoc_md42"></a>
Resources and Solution Details</h3>
<ul>
<li>Security remarks section of LoadLibraryEx documentation by Microsoft: <a href="https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa#security-remarks">https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa#security-remarks</a> <br  />
</li>
<li>Microsoft Dynamic Link Library Security article: <a href="https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security">https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security</a> <br  />
</li>
<li>Hijack Execution Flow: DLL Search Order Hijacking: <a href="https://attack.mitre.org/techniques/T1574/001">https://attack.mitre.org/techniques/T1574/001</a> <br  />
</li>
<li>Hijack Execution Flow: DLL Side-Loading: <a href="https://attack.mitre.org/techniques/T1574/002">https://attack.mitre.org/techniques/T1574/002</a> <br  />
 </li>
</ul>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7 </li>
  </ul>
</div>
</body>
</html>
